<?php
/**
 * cfg.php
 *
 * Main config file
 *
 * @package Public
 */

// Compatibility
$version = '5.2.3';//restricted by htmlentities()' 4th parameter
if(version_compare(PHP_VERSION, $version, '<')) {
	die('Required PHP version is ' . $version . ', current is ' . PHP_VERSION);
}

// Environment
define('DEVELOPMENT', in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')));
define('PRIVATE_DIR', DEVELOPMENT ? 'private' . DIRECTORY_SEPARATOR : '..'.DIRECTORY_SEPARATOR.'private_html'.DIRECTORY_SEPARATOR.'tickets');
define('APPLICATION_LINK','application_red'.DIRECTORY_SEPARATOR);
define('LIBRARY_LINK','library'.DIRECTORY_SEPARATOR);
define("MEM_START",memory_get_usage(true));

// Behavior
if(DEVELOPMENT) {
	ini_set('display_errors', 'On');
	error_reporting(E_ALL | E_STRICT);//report all errors
}
else {
	ini_set('display_errors', 'Off');
	error_reporting(0);
}

// Timezone
date_default_timezone_set('Europe/Amsterdam');

// Constants
define('ROOT',	dirname(__FILE__) . DIRECTORY_SEPARATOR);
define('APP',	ROOT . '..'.DIRECTORY_SEPARATOR.PRIVATE_DIR.''.APPLICATION_LINK);
define('LIB',	ROOT . '..'.DIRECTORY_SEPARATOR.PRIVATE_DIR.''.LIBRARY_LINK);
define('CACHE',	APP.'cache'.DIRECTORY_SEPARATOR);